Image encoding apparatus, image encoding method, image decoding apparatus, image decoding method, and non-transitory computer-readable storage medium

ABSTRACT

In prediction, one of a first mode for deriving, using pixels in an image including a target block, predicted pixels in the target block, a second mode for deriving the predicted pixels in the target block using pixels in an image different from the image including the target block, a third mode for generating the predicted pixels in the target block using both the pixels in the image including the target block and pixels in the different image can be used. If the third mode is used in at least one of the first and second blocks, the intensity of deblocking filter to be performed for the boundary between the first and second blocks is set to the same intensity as in a case in which the first mode is used in at least one of the first and second blocks.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a Continuation of International Patent ApplicationNo. PCT/JP2019/044115, filed Nov. 11, 2019, which claims the benefit ofJapanese Patent Application No. 2018-235911, filed Dec. 17, 2018, bothof which are hereby incorporated by reference herein in their entirety.

BACKGROUND OF THE INVENTION Field of the Invention

The present invention relates to an image encoding technique and animage decoding technique.

Background Art

As an encoding method for moving image compression recording, anH.264/AVC encoding method (to be referred to as H.264 hereinafter) andan HEVC (High Efficiency Video Coding) encoding method (to be referredto as HEVC hereinafter) are known. In the HEVC, to improve the encodingefficiency, a basic block having a size larger than a conventional macroblock (16 pixels×16 pixels) is employed. The basic block with the largesize is called a CTU (Coding Tree Unit), and its size is 64 pixels×64pixels at maximum. The CTU is further divided into sub-blocks each ofwhich is a unit to perform prediction or conversion.

Also, in the HEVC, adaptive deblocking filter processing is performedfor the block boundary of reconstructed images obtained by adding asignal of inverse quantizing/inverse converting processing and apredicted image, thereby suppressing a visually noticeable blockdistortion and preventing image quality degradation from propagating tothe predicted image. PTL 1 discloses a technique concerning suchdeblocking filtering.

In recent years, actions have been launched to implement internationalstandardization of an encoding method of a higher efficiency as asuccessor of the HEVC. JVET (Joint Video Experts Team) was foundedbetween ISO/TEC and ITU-T, and standardization of a VVC (Versatile VideoCoding) encoding method (to be referred to as VVC hereinafter) has beenpromoted. To improve the encoding efficiency, in addition toconventional intra-prediction and inter-prediction, a new predictionmethod (to be referred to as weighted intra-/inter-predictionhereinafter) using both intra-predicted pixels and inter-predictedpixels has been examined.

In the VVC as well, introduction of deblocking filtering has beenexamined, like the HEVC. Also, in the VVC, in addition to conventionalintra-prediction and inter-prediction, introduction of weightedintra-/inter-prediction that generates a new predicted pixel using bothintra-predicted pixels and inter-predicted pixels has been examined. Inthe HEVC, the deblocking filter intensity decision method is based on aprediction method such as intra-prediction/inter-prediction. On theother hand, in the weighted intra-/inter-prediction that is a newprediction method as well, the intensity of deblocking filter is decidedby the same method as in inter-prediction. However, this cannotsufficiently suppress a distortion at a block boundary. The presentinvention provides a technique of appropriately deciding the intensityof deblocking filter processing for weighted intra-/inter-prediction andsuppressing a distortion generated at a block boundary.

CITATION LIST Patent Literature

-   PTL 1: Japanese Patent Laid-Open No. 2014-507863

SUMMARY OF THE INVENTION

According to the first aspect of the present invention, there isprovided an image encoding apparatus comprising: an encoding unitconfigured to encode a sequence of images by performing predictionprocessing for each block; a decision unit configured to decide at leastan intensity of deblocking filter processing to be performed for aboundary between a first block and a second block adjacent to the firstblock, based on a mode used in the prediction processing of the firstblock and a mode used in the prediction processing of the second block;and a processing unit configured to perform the deblocking filterprocessing for the boundary according to the intensity decided by thedecision unit, wherein the encoding unit can use, in the predictionprocessing, one of: a first mode for deriving predicted pixels in atarget block to be encoded, using pixels in an image including thetarget block; a second mode for deriving the predicted pixels in thetarget block using pixels in an image different from the image includingthe target block; and a third mode for generating the predicted pixelsin the target block using both the pixels in the image including thetarget block and the pixels in the image different from the imageincluding the target block, and wherein if the third mode is used in atleast one of the first block and the second block, the decision unitsets the intensity of the deblocking filter processing to be performedfor the boundary between the first block and the second block to thesame intensity as in a case in which the first mode is used in at leastone of the first block and the second block.

According to the second aspect of the present invention, there isprovided an image decoding apparatus for decoding encoded image data foreach block, comprising: a decoding unit configured to decode an image byperforming prediction processing for each block; a decision unitconfigured to decide at least an intensity of deblocking filterprocessing to be performed for a boundary between a first block and asecond block adjacent to the first block, based on a mode used in theprediction processing of the first block and a mode used in theprediction processing of the second block; and a processing unitconfigured to perform the deblocking filter processing for the boundaryaccording to the intensity decided by the decision unit, wherein thedecoding unit can use, in the prediction processing, one of: a firstmode for deriving predicted pixels in a target block to be decoded,using pixels in an image including the target block; a second mode forderiving the predicted pixels in the target block using pixels in animage different from the image including the target block; and a thirdmode for generating the predicted pixels in the target block using boththe pixels in the image including the target block and the pixels in theimage different from the image including the target block, and whereinif the third mode is used in at least one of the first block and thesecond block, the decision unit sets the intensity of the deblockingfilter processing to be performed for the boundary between the firstblock and the second block to the same intensity as in a case in whichthe first mode is used in at least one of the first block and the secondblock.

According to the third aspect of the present invention, there isprovided an image encoding method comprising: encoding a sequence ofimages by performing prediction processing for each block; deciding atleast an intensity of deblocking filter processing to be performed for aboundary between a first block and a second block adjacent to the firstblock, based on a mode used in the prediction processing of the firstblock and a mode used in the prediction processing of the second block;and performing the deblocking filter processing for the boundaryaccording to the intensity decided in the deciding, wherein the encodingcan use, in the prediction processing, one of: a first mode for derivingpredicted pixels in a target block to be encoded, using pixels in animage including the target block; a second mode for deriving thepredicted pixels in the target block using pixels in an image differentfrom the image including the target block; and a third mode forgenerating the predicted pixels in the target block using both thepixels in the image including the target block and the pixels in theimage different from the image including the target block, and whereinif the third mode is used in at least one of the first block and thesecond block, the deciding sets the intensity of the deblocking filterprocessing to be performed for the boundary between the first block andthe second block to the same intensity as in a case in which the firstmode is used in at least one of the first block and the second block.

According to the fourth aspect of the present invention, there isprovided an image decoding method for decoding encoded image data foreach block, comprising: decoding an image by performing predictionprocessing for each block; deciding at least an intensity of deblockingfilter processing to be performed for a boundary between a first blockand a second block adjacent to the first block, based on a mode used inthe prediction processing of the first block and a mode used in theprediction processing of the second block; and performing the deblockingfilter processing for the boundary according to the intensity decided inthe deciding, wherein the decoding can use, in the predictionprocessing, one of: a first mode for deriving predicted pixels in atarget block to be decoded, using pixels in an image including thetarget block; a second mode for deriving the predicted pixels in thetarget block using pixels in an image different from the image includingthe target block; and a third mode for generating the predicted pixelsin the target block using both the pixels in the image including thetarget block and the pixels in the image different from the imageincluding the target block, and wherein if the third mode is used in atleast one of the first block and the second block, the deciding sets theintensity of the deblocking filter processing to be performed for theboundary between the first block and the second block to the sameintensity as in a case in which the first mode is used in at least oneof the first block and the second block.

According to the fifth aspect of the present invention, there isprovided a non-transitory computer-readable storage medium for storing acomputer program configured to cause a computer to function as: anencoding unit configured to encode a sequence of images by performingprediction processing for each block; a decision unit configured todecide at least an intensity of deblocking filter processing to beperformed for a boundary between a first block and a second blockadjacent to the first block, based on a mode used in the predictionprocessing of the first block and a mode used in the predictionprocessing of the second block; and a processing unit configured toperform the deblocking filter processing for the boundary according tothe intensity decided by the decision unit, wherein the encoding unitcan use, in the prediction processing, one of: a first mode for derivingpredicted pixels in a target block to be encoded, using pixels in animage including the target block; a second mode for deriving thepredicted pixels in the target block using pixels in an image differentfrom the image including the target block; and a third mode forgenerating the predicted pixels in the target block using both thepixels in the image including the target block and the pixels in theimage different from the image including the target block, and whereinif the third mode is used in at least one of the first block and thesecond block, the decision unit sets the intensity of the deblockingfilter processing to be performed for the boundary between the firstblock and the second block to the same intensity as in a case in whichthe first mode is used in at least one of the first block and the secondblock.

According to the sixth aspect of the present invention, there isprovided a non-transitory computer-readable storage medium for storing acomputer program configured to cause a computer to function as: adecoding unit configured to decode an image by performing predictionprocessing for each block; a decision unit configured to decide at leastan intensity of deblocking filter processing to be performed for aboundary between a first block and a second block adjacent to the firstblock, based on a mode used in the prediction processing of the firstblock and a mode used in the prediction processing of the second block;and a processing unit configured to perform the deblocking filterprocessing for the boundary according to the intensity decided by thedecision unit, wherein the decoding unit can use, in the predictionprocessing, one of: a first mode for deriving predicted pixels in atarget block to be decoded, using pixels in an image including thetarget block; a second mode for deriving the predicted pixels in thetarget block using pixels in an image different from the image includingthe target block; and a third mode for generating the predicted pixelsin the target block using both the pixels in the image including thetarget block and the pixels in the image different from the imageincluding the target block, and wherein if the third mode is used in atleast one of the first block and the second block, the decision unitsets the intensity of the deblocking filter processing to be performedfor the boundary between the first block and the second block to thesame intensity as in a case in which the first mode is used in at leastone of the first block and the second block.

Further features of the present invention will become apparent from thefollowing description of exemplary embodiments with reference to theattached drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram showing an example of the functionalconfiguration of an image encoding apparatus;

FIG. 2 is a block diagram showing an example of the functionalconfiguration of an image decoding apparatus;

FIG. 3 is a flowchart of encoding processing;

FIG. 4 is a flowchart of decoding processing;

FIG. 5 is a block diagram showing an example of the hardwareconfiguration of a computer apparatus;

FIG. 6 is a view showing an example of the configuration of a bitstream;and

FIG. 7 is a view showing an example of deblocking filter processing.

DESCRIPTION OF THE EMBODIMENTS

The embodiments of the present invention will now be described withreference to the accompanying drawings. Note that an embodiment to bedescribed below shows an example when the present invention isimplemented in detail, and is one of detailed embodiments of aconfiguration described in claims. For example, in the followingexplanation, terms such as “basic block” and “sub-block” are used.However, the embodiments can be applied to various processing unitscalled “block” and “unit” in an image encoding technique.

First Embodiment

An example of the functional configuration of an image encodingapparatus according to this embodiment will be described first withreference to the block diagram of FIG. 1 . A control unit 199 controlsthe operation of the entire image encoding apparatus. A block dividingunit 102 divides an input image (the image of each frame of a movingimage, or a still image) into a plurality of basic blocks and outputseach basic block (divided image).

A prediction unit 103 divides each basic block into a plurality ofsub-blocks (divided images). For each sub-block, the prediction unit 103generates a predicted image by performing infra-frame prediction(intra-prediction), inter-frame prediction (inter-prediction), orweighted intra-/inter-prediction that adds weights to both intra-frameprediction and inter-frame prediction and combines these. Then, for eachsub-block, the prediction unit 103 obtains the difference between thepredicted image and the sub-block as a prediction error. Also, theprediction unit 103 generates, as prediction information, informationrepresenting how the basic block is divided into sub-blocks, theprediction mode, and information necessary for prediction such as amotion vector.

A converting/quantizing unit 104 performs orthogonal transformation ofthe prediction error of each sub-block, thereby obtaining transformationcoefficients (orthogonal transformation coefficients) of each sub-block.The converting/quantizing unit 104 quantizes the transformationcoefficients of each sub-block, thereby generating quantizedcoefficients of the sub-block.

An inverse quantizing/inverse converting unit 105 generatestransformation coefficients by inversely quantizing the quantizedcoefficients of each sub-block generated by the converting/quantizingunit 104 using the quantization matrix used to quantize the sub-block,and performs inverse orthogonal transformation of the transformationcoefficients, thereby generating a prediction error.

An image regenerating unit 106 generates, based on the predictioninformation generated by the prediction unit 103, a predicted image fromthe encoded image data stored in a frame memory 107, and regenerates animage from the predicted image and the prediction error generated by theinverse quantizing/inverse converting unit 105. The image regeneratingunit 106 stores the regenerated image in the frame memory 107. The imagedata stored in the frame memory 107 is an image to be referred to by theprediction unit 103 when performing prediction (prediction processing)for the image of another frame.

An in-loop filtering unit 108 performs in-loop filtering processing suchas deblocking filtering or sample adaptive offsetting for the imagestored in the frame memory 107.

A filtering processing intensity calculation unit 112 calculates theintensity (bS value) of deblocking filter processing to be performed forthe boundary between sub-blocks adjacent to each other using theprediction information output from the prediction unit 103 and thequantized coefficients output from the converting/quantizing unit 104.

One of two sub-blocks adjacent to each other will be referred to as asub-block P, and the other as a sub-block Q. The bS value that is theintensity of deblocking filter processing performed for the boundarybetween the sub-block P and the sub-block Q is calculated in thefollowing way.

-   -   If at least one of the sub-block P and the sub-block Q is a        sub-block to which intra-prediction or weighted        intra-/inter-prediction is applied, bS value=2.    -   If a nonzero orthogonal transformation coefficient exists in at        least one of the sub-block P and the sub-block Q, bS value=1.    -   Otherwise, if the absolute value (magnitude) of the difference        between a motion vector of the sub-block P and a motion vector        of the sub-block Q is equal to or larger than a predetermined        value (for example, one pixel or more), bS value=1.    -   Otherwise, if a reference image of motion compensation is        different between the sub-block P and the sub-block Q, or if the        number of motion vectors is different, bS value=1.    -   Otherwise, bS value=0.

Here, as the bS value becomes large, deblocking filter processing usingdeblocking filter of a higher intensity is performed. In thisembodiment, when bS value=0, deblocking filter processing is notexecuted. When bS value=1, deblocking filter processing is executed onlyfor luminance components. When bS value=2, deblocking filter processingis executed for luminance components and color difference components.That is, in this embodiment, the bS value represents whether to performdeblocking filter processing or represents the type of signals (imagecomponents) such as luminance components or color difference componentsas the target of the deblocking filter processing. However, the presentinvention is not limited to this. The number of types of deblockingfilter processing intensity may be larger or smaller. The contents ofprocessing according to the intensity of deblocking filter processingmay also be different.

For example, the bS value may take values of five levels from 0 to 4, asin deblocking filter processing of H.264. In this embodiment, theintensity of deblocking filter processing for the boundary betweensub-blocks using weighted intra-/inter-prediction has the same value asthat when the sub-blocks use intra-prediction. This indicates that bSvalue=2, that is, the intensity is maximum. However, the embodiment isnot limited to this. An intermediate bS value may be provided between bSvalue=1 and bS value=2 in this embodiment, and if at least one of thesub-block P and the sub-block Q uses weighted intra-/inter-prediction,the intermediate bS value may be used. In this case, deblocking filterprocessing similar to that in the normal case in which bS value=2 can beexecuted to luminance components, and deblocking filter processing whoseintensity of a smoothing effect is lower than in a case in which bSvalue=2 can be executed for color difference components. This makes itpossible to execute deblocking filter processing of an intermediatesmoothing degree to the boundary between sub-blocks using weightedintra-/inter-prediction. The simple term “intensity of deblocking filterprocessing” as described above means changing the intensity ofdeblocking filter processing by changing a signal (a luminance componentor a color difference component) as the target of deblocking filterprocessing or changing the intensity of the smoothing effect ofcorrecting a signal by deblocking filter.

As described above, the intensity of deblocking filter processing to beperformed for the boundary between adjacent blocks in a regeneratedimage (decoded image) stored in the frame memory 107 is decided based oninformation obtained in the process of predictive encoding of eachblock.

In this embodiment, deblocking filter is applied to an image region of 8pixels×8 pixels including the boundary of sub-blocks, therebyimplementing deblocking filter processing for the image region.

Deblocking filter processing performed by the in-loop filtering unit 108will be described here in detail using an example shown in FIG. 7 . InFIG. 7 , the sub-block Q (block Q in FIG. 7 ) having a size of 8pixels×8 pixels is adjacent to the right side of the sub-block P (blockP in FIG. 7 ) having a size of 8 pixels×8 pixels. Here, deblockingfilter processing is performed for the boundary portion (8 pixels(horizontal)×8 pixels (vertical) formed from 4 pixels (horizontal)×8pixels (vertical) at the right end of the sub-block P and 4 pixels(horizontal)×8 pixels (vertical) at the left end of the sub-block Q)between the sub-block P and the sub-block Q. At this time, processing tobe described below is performed for each of the upper half and the lowerhalf of the boundary portion, thereby implementing deblocking filterprocessing for each of the upper half and the lower half. Here, theupper half of the boundary portion indicates a pixel region of 8 pixels(horizontal)×4 pixels (vertical) formed from 4 pixels (horizontal)×4pixels (vertical) on the upper right side of the sub-block P and 4pixels (horizontal)×4 pixels (vertical) on the upper left side of thesub-block Q. In addition, the lower half of the boundary portionindicates a pixel region of 8 pixels (horizontal)×4 pixels (vertical)formed from 4 pixels (horizontal)×4 pixels (vertical) on the lower rightside of the sub-block P and 4 pixels (horizontal)×4 pixels (vertical) onthe lower left side of the sub-block Q.

Deblocking filter processing for the lower half of the boundary portionwill be described below. Deblocking filter processing to be describedbelow is similarly applied to the upper half of the boundary portion.

Rectangles with p00 to p33 added in FIG. 7 represent pixels in the pixelregion of 4 pixels (horizontal)×4 pixels (vertical) on the lower rightside of the sub-block P, and p00 to p33 indicate pixel values. q00 toq33 in FIG. 7 represent pixels in the pixel region of 4 pixels(horizontal)×4 pixels (vertical) on the lower left side of the sub-blockQ, and q00 to q33 indicate pixel values. First, concerning a luminancesignal, if bS value≥1, whether to perform filtering processing isdetermined using the following inequality.|p20−2×p10+p00|+|p23−2×p13+p03|+|q20−2×q10+q00|+|q23−2×q13+q03|<βwhere β is a value obtained from the average value of a quantizationparameter of the sub-block P and a quantization parameter of thesub-block Q. Only when this inequality is satisfied, it is determined toperform deblocking filter processing. When deblocking filter processingis to be performed, it is determined next which one of strong filteringand weak filtering, which have different smoothing effects, is to beused. If all inequalities (1) to (6) to be shown below are satisfied, itis determined to use strong filtering having a high smoothing effect.Otherwise, it is determined to use weak filtering whose smoothing effectis weaker than strong filtering.2×(|p20−2×p10+p00|+|q20−2×q10+q00|)<(β>>2)  (1)2×(|p23−2×p13+p03|+|q23−2×q13+q03|)<(β>>2)  (2)|p30−p00|+|q00−q30|<(β>>3)  (3)|p33−p03|+|q03−q33|<(β>>3)  (4)|p00−q00|<((5×tc+1)>>1)  (5)|p03−q03|<((5×tc+1)>>1)  (6)where >>N (N=1 to 3) means N-bit arithmetic right shift calculation, andtc is a value obtained from the bS value, the quantization parameter ofthe sub-block P, and the quantization parameter of the sub-block Q.

Letting p′0k, p′1k, p′2k, q′0k, q′1k, and q′2k (k=0 to 3) be pixelsafter filtering, strong filtering processing having a high smoothingeffect for a luminance signal is represented byp′0k=Clip3(p0k−2×tc,p0k+2×tc,(p2k+2×p1k+2×p0k+2×q0k+q1k+4)>>3)p′1k=Clip3(p1k−2×tc,p1k+2×tc,(p2k+p1k+p0k+q0k+2)>>2)p′2k=Clip3(p2k−2×tc,p2k+2×tc,(2×p3k+3×p2k+p1k+p0k+q0k+4)>>3)q′0k=Clip3(q0k−2×tc,q0k+2×tc,(q2k+2×q1k+2×q0k+2×p0k+p1k+4)>>3)q′1k=Clip3(q1k−2×tc,q1k+2×tc,(q2k+q1k+q0k+p0k+2)>>2)q′2k=Clip3(q2k−2×tc,q2k+2×tc,(2×q3k+3×q2k+q1k+q0k+p0k+4)>>3)where Clip3(a, b, c) is a function for performing clip processing suchthat the range of c satisfies a≤b≤c. On the other hand, weak filteringprocessing having a low smoothing effect for a luminance signal isexecuted byΔ=(9×(q0k−p0k)−3×(q1k−p1k)+8)>>4|Δ|<10×tcIf this inequality is not satisfied, deblocking filter processing is notexecuted. If the inequality is satisfied, processing to be describedbelow is performed for the pixel value p0 k and the pixel value q0 k.Δ=Clip3(−tc,tc,Δ)p′0k=Clip1Y(p0k+Δ)q′0k=Clip1Y(q0k−Δ)where Clip1Y(a) is a function for performing clip processing such thatthe range of a satisfies 0≤a≤(a maximum value that can be expressed bythe bit depth of a luminance signal). Also, if conditions represented by|p20−2×p10+p00|+|p23−2×p13+p03|<(β+(ρ>>1))>>3)|q20−2×q10+q00|+|q23−2×q13+q03|<(β+(β>>1))>>3)are satisfied, the following filtering processing is performed for p1 kand q1 k.Δp=Clip3(−(tc>>1),tc>>1,(((p2k+p0k+1)>>1)−p1k+Δ)>>1)p′1k=Clip1Y(p1k+Δp)Δq=Clip3(−(tc>>1),tc>>1,(((q2k+q0k+1)>>1)−q1k+Δ)>>1)q′1k=Clip1Y(q1k+Δq)

As for deblocking filter processing of a color difference signal, thefollowing processing is performed only when bS value=2.Δ=Clip3(−tc,tc,((((q0k−p0k)>>2)+p1k−q1k+4)>>3))p′0k=Clip1C(p0k+Δ)p′0k=Clip1C(p0k−Δ)where Clip1C(a) is a function for performing clip processing such thatthe range of a satisfies 0≤a≤(a maximum value that can be expressed bythe bit depth of a color difference signal). In this embodiment, the bSvalue representing the intensity of deblocking filter processingindicates the type of a signal as the target of deblocking filterprocessing, and additionally, a strong filter having a high smoothingeffect and a weak filter having a low smoothing effect are selectivelyused in accordance with the condition of a pixel value. However, thepresent invention is not limited to this. For example, not only the typeof the signal but also the intensity of the smoothing effect may bedecided in accordance with the bS value. Alternatively, only theintensity of the smoothing effect may be decided based on the bS value,and the type of the signal may be decided based on another condition.

An encoding unit 109 encodes the quantized coefficients generated by theconverting/quantizing unit 104 and the prediction information generatedby the prediction unit 103, thereby generating encoded data. A combinedencoding unit 110 generates a bitstream including the encoded datagenerated by the encoding unit 109 and header data including informationnecessary for decoding of an input image and outputs the bitstream.

The operation of the image encoding apparatus according to thisembodiment will be described next. The block dividing unit 102 dividesan input image into a plurality of basic blocks and outputs each of thedivided basic blocks.

On a basic block basis, the prediction unit 103 divides the basic blockinto a plurality of sub-blocks (divided images). For each sub-block, theprediction unit 103 decides which one of the following predictionmethods is to be used for encoding.

-   -   intra-prediction such as horizontal prediction or vertical        prediction    -   inter-prediction for performing motion compensation from a        reference frame    -   weighted intra-/inter-prediction that combines intra-prediction        and inter-prediction

The prediction methods used in this embodiment will be described anew.In intra-prediction, using encoded pixels spatially located around ablock (encoding target block) as an encoding target, predicted pixels ofthe encoding target block are generated (derived), and anintra-prediction mode representing an intra-prediction method such ashorizontal prediction, vertical prediction, or DC prediction is alsogenerated.

In inter-prediction, using encoded pixels of a frame temporallydifferent from the encoding target block, predicted pixels of theencoding target block are generated, and motion information representinga frame to be referred to, a motion vector, or the like is alsogenerated.

In weighted intra-/inter-prediction, the pixel values of predictedpixels of the encoding target block are generated by obtaining theweighted average of the pixel values generated by the above-describedintra-prediction and the pixel values generated by the above-describedinter-prediction (using both). The pixel values of the predicted pixelsare calculated using, for example, equation (1) below (an equation in acase in which the size of the basic block is 8 pixels×8 pixels).p[x][y]=(w×pInter[x][y]+(8−w)×pIntra[x][y])>>3)  (1)

“>>” represents a bit shift to the right. In equation (1), p[x][y] isthe pixel value of a predicted pixel by weightedintra-/inter-prediction, which is calculated for coordinates (x, y) inthe encoding target block. pInter[x][y] is the pixel value byinter-prediction for the coordinates (x, y) in the encoding targetblock, and pInter[x][y] is the pixel value by inter-prediction for thecoordinates (x, y) in the encoding target block. w represents a weightvalue for the pixel values of inter-prediction and the pixel values ofintra-prediction. In this embodiment, when w=4, weights for the pixelvalues of inter-prediction and the pixel values of intra-predictionbecome equal. In other words, if w>4, the weight for the pixel values ofinter-prediction increases. If w<4, the weight for the pixel values ofintra-prediction increases. The deciding method of the weight value isnot particularly limited, and the weight value is decided in accordancewith the size of a motion vector, the position of an encoding targetblock, and the like of the intra-prediction mode or inter-prediction. Inweighted intra-/inter-prediction, the predicted pixels of the encodingtarget block are generated in this way, and the intra-prediction modeand motion information used to generate the predicted pixels are alsogenerated.

The prediction unit 103 then generates a predicted image from thedecided prediction method and encoded pixels, and generates a predictionerror from the sub-block and the predicted image. The prediction unit103 also generates, as prediction information, information representinghow the basic block is divided into sub-blocks, the prediction mode, andinformation necessary for prediction such as a motion vector.

The converting/quantizing unit 104 performs orthogonal transformation ofthe prediction error of each sub-block, thereby generatingtransformation coefficients of each sub-block. The converting/quantizingunit 104 quantizes the transformation coefficients of each sub-block,thereby generating quantized coefficients of the sub-block.

The inverse quantizing/inverse converting unit 105 generatestransformation coefficients by inversely quantizing the quantizedcoefficients of each sub-block generated by the converting/quantizingunit 104 using the quantization matrix used to quantize the sub-block,and performs inverse orthogonal transformation of the transformationcoefficients, thereby generating a prediction error.

The image regenerating unit 106 generates, based on the predictioninformation generated by the prediction unit 103, a predicted image fromthe encoded image data stored in the frame memory 107, and regeneratesan image from the predicted image and the prediction error generated bythe inverse quantizing/inverse converting unit 105. The imageregenerating unit 106 stores the regenerated image in the frame memory107.

The filtering processing intensity calculation unit 112 calculates theintensity of deblocking filter processing to be performed for theboundary between sub-blocks adjacent to each other by performing theabove-described processing using the prediction information output fromthe prediction unit 103 and the quantized coefficients output from theconverting/quantizing unit 104.

The in-loop filtering unit 108 performs in-loop filtering processingsuch as deblocking filtering or sample adaptive offsetting for the imagestored in the frame memory 107. Deblocking filter processing to beperformed by the in-loop filtering unit 108 is based on the intensityobtained by the filtering processing intensity calculation unit 112.

The encoding unit 109 entropy-encodes the quantized coefficientsgenerated by the converting/quantizing unit 104 and the predictioninformation generated by the prediction unit 103, thereby generatingencoded data. The method of entropy encoding is not particularlydesignated, and Golomb coding, arithmetic coding, Huffman coding, or thelike can be used.

The combined encoding unit 110 generates a bitstream by multiplexing theencoded data, header data, and the like generated by the encoding unit109, and outputs the generated bitstream.

Encoding processing of an input image by the above-described imageencoding apparatus will be described with reference to the flowchart ofFIG. 3 . In step S301, the combined encoding unit 110 encodes a headernecessary for encoding of an image, thereby generating header data(encoded data).

In step S302, the block dividing unit 102 divides an input image into aplurality of basic blocks. In step S303, the prediction unit 103selects, as a selected basic block, an unselected one of the basicblocks divided in step S302. The prediction unit 103 decides a sub-blockdividing method (in this embodiment, one prediction method out ofintra-prediction, inter-prediction, and weightedintra-/inter-prediction), and divides the selected basic block into aplurality of sub-blocks in accordance with the decided sub-blockdividing method. Also, the prediction unit 103 decides the predictionmethod on a sub-block basis. For each sub-block, the prediction unit 103generates a predicted image by performing prediction in accordance withthe decided prediction method using an image in the frame memory 107,and obtains the difference between the sub-block and the predicted imageas a prediction error. Also, the prediction unit 103 generates, asprediction information, information representing the sub-block dividingmethod, the prediction mode, and information necessary for predictionsuch as a motion vector.

In step S304, the converting/quantizing unit 104 performs orthogonaltransformation of the prediction error of each sub-block, therebygenerating transformation coefficients of each sub-block. Theconverting/quantizing unit 104 quantizes the transformation coefficientsof each sub-block, thereby generating quantized coefficients of thesub-block.

In step S305, the inverse quantizing/inverse converting unit 105generates transformation coefficients by inversely quantizing thequantized coefficients of each sub-block generated in step S304 usingthe quantization matrix used to quantize the sub-block. Then, theinverse quantizing/inverse converting unit 105 performs inverseorthogonal transformation of the generated transformation coefficients,thereby generating a prediction error.

In step S306, the image regenerating unit 106 generates, based on theprediction information generated by the prediction unit 103, a predictedimage from the encoded image data stored in the frame memory 107. Then,the image regenerating unit 106 regenerates an image from the predictedimage and the prediction error generated by the inversequantizing/inverse converting unit 105. The image regenerating unit 106stores the regenerated image in the frame memory 107.

In step S307, the encoding unit 109 entropy-encodes the quantizedcoefficients generated by the converting/quantizing unit 104 and theprediction information generated by the prediction unit 103, therebygenerating encoded data. The combined encoding unit 110 multiplexes theheader data and the encoded data generated by the encoding unit 109,thereby generating a bitstream.

In step S308, the control unit 199 determines whether all basic blocksare encoded. As the result of the determination, if all basic blocks areencoded, the process advances to step S309. If an unencoded basic blockremains, the process returns to step S303.

In step S309, the filtering processing intensity calculation unit 112calculates the intensity of deblocking filter processing to be performedfor the boundary between sub-blocks adjacent to each other by performingthe above-described processing using the prediction information obtainedby the prediction unit 103 and the quantized coefficients obtained bythe converting/quantizing unit 104.

In step S310, the in-loop filtering unit 108 performs in-loop filteringprocessing such as deblocking filtering or sample adaptive offsettingfor the image stored in the frame memory 107. Deblocking filterprocessing to be performed for the boundary between sub-blocks adjacentto each other is based on the intensity obtained for the boundary by thefiltering processing intensity calculation unit 112.

As described above, according to this embodiment, particularly in stepS309, deblocking filter having a high distortion correction effect canbe set for the boundary between sub-blocks using weightedintra-/inter-prediction. This can suppress a block distortion andimprove subjective image quality. Also, since no new operation is neededfor the calculation of the intensity of deblocking filter processing,the complexity of implementation is not increased.

Additionally, in this embodiment, the presence/absence of deblockingfilter processing for the block boundary of luminance or colordifference is changed depending on the intensity (bS value) ofdeblocking filter processing. However, the intensity of the smoothingeffect of the filter itself may be changed by the intensity (bS value).For example, when the intensity (bS value) of deblocking filterprocessing is high, a filter having a longer tap length and a highcorrection effect can be used. When the intensity (bS value) ofdeblocking filter processing is low, a filter having a shorter taplength and a low correction effect can be used. This makes it possibleto adjust the intensity of the filter, that is, the correction effect bya method other than the presence/absence of deblocking filterprocessing.

Second Embodiment

In the following embodiments including this embodiment, differences fromthe first embodiment will be described, and the rest is the same as inthe first embodiment unless otherwise specified below. In thisembodiment, an image encoding apparatus performs the followingprocessing in accordance with the flowchart of FIG. 3 .

FIG. 6 shows an example of the configuration of a bitstream according tothis embodiment. A picture header stores filter_weight_threshold that isthe weight threshold (intensity weight threshold) of the intensity ofdeblocking filter processing. This is a threshold for deciding, by aweight value w in weighted intra-/inter-prediction, whether a sub-blockshould be handled as a sub-block to which intra-prediction is applied ora sub-block to which inter-prediction is applied when calculating the bSvalue of the deblocking filter.

In step S309, a filtering processing intensity calculation unit 112calculates a bS value. More specifically, if the following inequalityholds, the bS value is calculated by handling a sub-block of weightedintra-/inter-prediction as a sub-block of intra-prediction.w<filter_weight_thresholdFor example, if the value of filter_weight_threshold is 4, allsub-blocks of weighted intra-/inter-prediction, which have a weightvalue w smaller than 4, are handled as sub-blocks of intra-prediction.All sub-blocks of weighted intra-/inter-prediction, which have a weightvalue w of 4 or more, are handled as sub-blocks of inter-prediction. Thefollowing table shows an example of bS values when a sub-block P and asub-block Q shown in FIG. 7 are encoded by intra-prediction,inter-prediction, weighted intra-/inter-prediction (w=3), and weightedintra-/inter-prediction (w=5).

TABLE 1 Prediction Methods of Blocks P and Q and bS Values Block Q intrainter w = 3 w = 5 Block P intra 2 2 2 2 inter 2 1 or less 2 1 or less w= 3 2 2 2 2 w = 5 2 1 or less 2 1 or less

In this table, filter_weight_threshold=4. For example, if at least oneof the sub-block P and the sub-block Q, which are adjacent, is encodedby intra-prediction or weighted intra-/inter-prediction (w=3), the onesub-block is handled as an intra-prediction block. Hence, the bS valueis set to 2. If both the sub-block P and the sub-block Q are encoded byinter-prediction or weighted intra-/inter-prediction (w=5), both thesub-block P and the sub-block Q are handled as inter-prediction blocks.Hence, the bS value is set to 0 or 1. Whether to set the bS value to 0or 1 is determined as in the filtering processing intensity calculationunit 112 according to the first embodiment. This is decided depending onthe presence/absence of non-zero orthogonal transformation coefficientsin the sub-block P and the sub-block Q, the difference in the number orsize of motion vectors, the difference in the reference image, and thelike.

The filtering processing intensity calculation unit 112 decides the bSvalue by referring to the data in the table. Note that in thisembodiment, filter_weight_threshold is stored in the picture header.However, the storage destination is not limited to a specific storagedestination, and filter_weight_threshold may be stored in, for example,the sequence header. Also, in this embodiment, the intensity weightthreshold is stored in the header as information used to determinewhether a sub-block of weighted intra-/inter-prediction should behandled as a sub-block of intra-prediction or a sub-block ofinter-prediction when calculating the bS value. However, the presentinvention is not limited to this. Flag information representing that asub-block should always be handled as a sub-block of intra-predictionmay be stored, or flag information representing that a sub-block shouldalways be handled as a sub-block of inter-prediction may be stored.Alternatively, a value obtained by subtracting 4 from the value offilter_weight_threshold in advance may be set as an intensity weightthreshold filter_weight_threshold_minus4. Since the possibility that thevalue of filter_weight_threshold_minus4 is set to 0 or a value close to0 becomes high, the code amount of information itself can be decreasedby Golomb coding or the like.

As described above, according to this embodiment, it is possible todecide the intensity of deblocking filter processing for a sub-block ofweighted intra-/inter-prediction without needing complex processing. Inaddition, the user can freely adjust the intensity of deblocking filterprocessing for a block of weighted intra-/inter-prediction.

Also, in this embodiment, information used to decide the intensity ofthe filter is output to the header. However, the present invention isnot limited to this. Whether a sub-block of weightedintra-/inter-prediction should be handled as a sub-block ofintra-prediction or a sub-block of inter-prediction may uniquely bedecided in advance by the value w. Alternatively, deblocking filter thatsmooths strongly as the weight of intra-prediction becomes large may beapplied independently of the bS value. Hence, a code amountcorresponding to the intensity weight threshold can be saved, andimplementation complexity can be lowered by fixing deblocking filterprocessing using the prediction mode.

Third Embodiment

In this embodiment, an image decoding apparatus that decodes an inputimage encoded by the image encoding apparatus according to the firstembodiment will be described. An example of the functional configurationof the image decoding apparatus according to this embodiment will bedescribed with reference to the block diagram of FIG. 2 .

A control unit 299 controls the operation of the entire image decodingapparatus. A demultiplexing/decoding unit 202 acquires a bitstreamgenerated by the image encoding apparatus, demultiplexes informationconcerning decoding processing and encoded data concerning coefficientsfrom the bitstream, and decodes encoded data existing in the header ofthe bitstream. In this embodiment, the demultiplexing/decoding unit 202performs an operation reverse to that of the above-described combinedencoding unit 110.

A decoding unit 203 decodes the encoded data demultiplexed from thebitstream by the demultiplexing/decoding unit 202, thereby acquiringquantized coefficients and prediction information. An inversequantizing/inverse converting unit 204 performs an operation similar tothat of the inverse quantizing/inverse converting unit 105 provided inthe above-described image encoding apparatus. The inversequantizing/inverse converting unit 204 acquires transformationcoefficients by inversely quantizing the quantized coefficients, andperforms inverse orthogonal transformation for the transformationcoefficients, thereby acquiring a prediction error.

An image regenerating unit 205 generates a predicted image by referringto an image stored in a frame memory 206 based on the predictioninformation decoded by the decoding unit 203. The image regeneratingunit 205 generates a regenerated image using the generated predictedimage and the prediction error obtained by the inversequantizing/inverse converting unit 204, and stores the generatedregenerated image in the frame memory 206.

A filtering processing intensity calculation unit 209 decides a bS valuethat is the intensity of deblocking filter processing for the boundarybetween adjacent sub-blocks using the prediction information and thequantized coefficients decoded by the decoding unit 203, like thefiltering processing intensity calculation unit 112.

An in-loop filtering unit 207 performs in-loop filtering processing suchas deblocking filtering for the regenerated image stored in the framememory 206, like the in-loop filtering unit 108. Deblocking filterprocessing by the in-loop filtering unit 207 is deblocking filterprocessing corresponding to the bS value obtained by the filteringprocessing intensity calculation unit 209.

The regenerated image stored in the frame memory 206 is appropriatelyoutput by the control unit 299. The output destination of theregenerated image is not limited to a specific output destination. Forexample, the regenerated image may be displayed on a display screen of adisplay device such as a display, or the regenerated image may be outputto a projection apparatus such as a projector.

The operation (bitstream decoding processing) of the image decodingapparatus having the above-described configuration will be describednext. In this embodiment, the bitstream input to thedemultiplexing/decoding unit 202 is a bitstream of each frame of amoving image. However, it may be a bitstream of a still image.

The demultiplexing/decoding unit 202 acquires a bitstream of one framegenerated by the image encoding apparatus, demultiplexes informationconcerning decoding processing and encoded data concerning coefficientsfrom the bitstream, and decodes encoded data existing in the header ofthe bitstream. Also, the demultiplexing/decoding unit 202 outputsencoded data of each basic block of picture data to the decoding unit203.

The decoding unit 203 decodes the encoded data demultiplexed from thebitstream by the demultiplexing/decoding unit 202, thereby acquiringquantized coefficients and prediction information. The predictioninformation includes information representing which one of the followingprediction methods was used to encode each sub-block.

-   -   intra-prediction such as horizontal prediction or vertical        prediction    -   inter-prediction for performing motion compensation from a        reference frame    -   weighted intra-/inter-prediction that combines intra-prediction        and inter-prediction

The inverse quantizing/inverse converting unit 204 acquirestransformation coefficients by inversely quantizing the quantizedcoefficients of each sub-block, and performs inverse orthogonaltransformation for the transformation coefficients, thereby acquiring aprediction error.

The image regenerating unit 205 generates a predicted image by referringto an image stored in the frame memory 206 based on the predictioninformation decoded by the decoding unit 203. The image regeneratingunit 205 generates a regenerated image using the generated predictedimage and the prediction error obtained by the inversequantizing/inverse converting unit 204, and stores the generatedregenerated image in the frame memory 206.

The filtering processing intensity calculation unit 209 decides a bSvalue that is the intensity of deblocking filter processing for theboundary between adjacent sub-blocks using the prediction informationand the quantized coefficients decoded by the decoding unit 203, likethe filtering processing intensity calculation unit 112.

The in-loop filtering unit 207 performs in-loop filtering processingsuch as deblocking filtering for the regenerated image stored in theframe memory 206, like the in-loop filtering unit 108. Deblocking filterprocessing by the in-loop filtering unit 207 is deblocking filterprocessing corresponding to the bS value obtained by the filteringprocessing intensity calculation unit 209.

In this embodiment, the bS value indicates the type of a signal (imagecomponent) as the processing target of the deblocking filtering, as inthe first embodiment. Additionally, a strong filter having a highsmoothing effect and a weak filter having a low smoothing effect areselectively used in accordance with the condition of a pixel value.However, the present invention is not limited to this. For example, notonly the type of the signal but also the intensity of the smoothingeffect may be decided in accordance with the bS value. Alternatively,only the intensity of the smoothing effect may be decided based on thebS value, and the type of the signal may be decided based on anothercondition.

Decoding processing of a bitstream corresponding to one frame by theimage decoding apparatus described above will be described withreference to the flowchart of FIG. 4 . In step S401, thedemultiplexing/decoding unit 202 acquires a bitstream corresponding toone frame generated by the image encoding apparatus. Thedemultiplexing/decoding unit 202 then demultiplexes informationconcerning decoding processing and encoded data concerning coefficientsfrom the bitstream, and decodes encoded data existing in the header ofthe bitstream.

Processes of steps S402 to S405 are performed for each basic block ofthe input image (in the image). In step S402, the decoding unit 203decodes the encoded data demultiplexed from the bitstream by thedemultiplexing/decoding unit 202, thereby acquiring quantizedcoefficients and prediction information.

In step S403, the inverse quantizing/inverse converting unit 204acquires transformation coefficients by inversely quantizing thequantized coefficients of the sub-block as the decoding target, andperforms inverse orthogonal transformation for the transformationcoefficients, thereby acquiring a prediction error.

In step S404, the image regenerating unit 205 generates a predictedimage by referring to an image stored in the frame memory 206 based onthe prediction information decoded by the decoding unit 203. The imageregenerating unit 205 generates a regenerated image using the generatedpredicted image and the prediction error obtained by the inversequantizing/inverse converting unit 204, and stores the generatedregenerated image in the frame memory 206.

In step S405, the control unit 299 determines whether decoding of allbasic blocks included in the bitstream is completed. As the result ofthe determination, if decoding of all basic blocks included in thebitstream is completed, the process advances to step S406. On the otherhand, if a basic block whose decoding is not completed yet remains inall basic blocks included in the bitstream, the processing from stepS402 is repeated for the basic block whose decoding is not completedyet.

In step S406, the filtering processing intensity calculation unit 209decides a bS value that is the intensity of deblocking filter processingfor the boundary between adjacent sub-blocks using the predictioninformation and the quantized coefficients decoded by the decoding unit203, like the filtering processing intensity calculation unit 112.

In step S407, the in-loop filtering unit 207 performs in-loop filteringprocessing such as deblocking filtering for the regenerated image storedin the frame memory 206 in step S404, like the in-loop filtering unit108. Deblocking filter processing by the in-loop filtering unit 207 isdeblocking filter processing corresponding to the bS value obtained bythe filtering processing intensity calculation unit 209 in step S406.

As described above, according to this embodiment, it is possible todecode a bitstream generated by the image encoding apparatus accordingto the first embodiment, in which an appropriate deblocking filter isapplied to a sub-block encoded by weighted intra-/inter-prediction.

Additionally, in this embodiment, the presence/absence of a filter forthe block boundary of luminance or color difference is changed dependingon the intensity (bS value) of deblocking filter processing. However,the intensity of the smoothing effect of the filter itself may bechanged by the intensity (bS value) of deblocking filter processing. Forexample, when the intensity (bS value) of deblocking filter processingis high, a filter having a longer tap length and a high correctioneffect can be used. When the intensity (bS value) of deblocking filterprocessing is low, a filter having a shorter tap length and a lowcorrection effect can be used. This makes it possible to decode abitstream for which the intensity of the filter, that is, the correctioneffect is adjusted by a method other than the presence/absence of afilter.

Fourth Embodiment

In this embodiment, an image decoding apparatus that decodes an inputimage encoded by the image encoding apparatus according to the secondembodiment will be described. In this embodiment, in processingaccording to the flowchart of FIG. 4 , the following points aredifferent from the third embodiment.

In step S401, a demultiplexing/decoding unit 202 demultiplexesinformation concerning decoding processing and encoded data concerningcoefficients from the bitstream shown in FIG. 6 , and decodes encodeddata existing in the header of the bitstream. In this decoding,filter_weight_threshold that is an intensity weight threshold in thepicture header is decoded.

In step S406, a filtering processing intensity calculation unit 209calculates a bS value. Note that in this embodiment, whether to set thebS value to 0 or 1 is determined as in the filtering processingintensity calculation unit 209 according to the third embodiment.

In this embodiment, filter_weight_threshold exists in the pictureheader. However, the present invention is not limited to this, andfilter_weight_threshold may exist in, for example, the sequence header.Also, in this embodiment, the intensity weight threshold is decoded asinformation used to determine whether a block of weightedintra-/inter-prediction should be handled as a sub-block ofintra-prediction or a sub-block of inter-prediction when calculating thebS value. However, the present invention is not limited to this. Flaginformation representing that a sub-block should always be handled as asub-block of intra-prediction may be decoded, or flag informationrepresenting that a sub-block should always be handled as a sub-block ofinter-prediction may be decoded. Alternatively, a value obtained bysubtracting 4 from the value of filter_weight_threshold in advance maybe decoded as an intensity weight thresholdfilter_weight_threshold_minus4. Since the possibility that the value offilter_weight_threshold_minus4 is set to 0 or a value close to 0 becomeshigh, a bitstream in which the code amount of information itself issmall can be decoded.

As described above, according to this embodiment, it is possible todecide the intensity of deblocking filter processing for a sub-block ofweighted intra-/inter-prediction without needing complex processing. Inaddition, it is possible to decode a bitstream for which the user hasfreely adjusted the intensity of deblocking filter processing for asub-block of weighted intra-/inter-prediction.

Also, in this embodiment, information used to decide the intensity ofthe filter is decoded from the header. However, the present invention isnot limited to this. Whether a sub-block of weightedintra-/inter-prediction should be handled as a sub-block ofintra-prediction or a sub-block of inter-prediction may uniquely bedecided in advance by the value w. Alternatively, deblocking filter thatsmooths strongly as the weight of intra-prediction becomes large may beapplied independently of the bS value. Hence, a bitstream in which acode amount corresponding to the intensity weight threshold is saved canbe decoded, and implementation complexity can be lowered by fixingdeblocking filter processing using the prediction mode.

Fifth Embodiment

All the functional units shown in FIGS. 1 and 2 may be implemented byhardware, and some may be implemented by software (computer programs).In this case, a computer apparatus including the frame memory 107 or theframe memory 206 as a memory device and capable of executing thecomputer programs can be applied to the above-described image encodingapparatus or image decoding apparatus. An example of the hardwareconfiguration of the computer apparatus applicable to theabove-described image encoding apparatus or image decoding apparatuswill be described with reference to the block diagram of FIG. 5 .

A CPU 501 executes various kinds of processing using computer programsand data stored in a RAM 502 or a ROM 503. Accordingly, the CPU 501performs operation control of the entire computer apparatus and executesor controls the processing described above as processing to be executedby the above-described image encoding apparatus or image decodingapparatus.

The RAM 502 has an area for storing computer programs and data loadedfrom the ROM 503 or an external storage device 506 and data (forexample, the above-described data of a moving image or a still image)received from the outside via an I/F (interface) 507. The RAM 502 alsohas a work area used by the CPU 501 to execute various kinds ofprocessing. The RAM 502 can thus appropriately provide various kinds ofareas. The setting data and the activation program of the computerapparatus are stored in the ROM 503.

An operation unit 504 is a user interface such as a keyboard, a mouse,or a touch panel. By operating the operation unit 504, a user can inputvarious kinds of instructions to the CPU 501.

A display unit 505 is formed by a liquid crystal screen or a touch panelscreen and can display a result of processing by the CPU 501 as an imageor characters. For example, a regenerated image decoded by theabove-described image decoding apparatus may be displayed on the displayunit 505. Note that the display unit 505 may be a projection apparatussuch as a projector that projects an image or characters.

The external storage device 506 is a mass information storage devicesuch as a hard disk drive. An OS (Operating System) and computerprograms and data used to cause the CPU 501 to execute or controlvarious kinds of processing described above as processing to be executedby the above-described image encoding apparatus or image decodingapparatus are stored in the external storage device 506. The computerprograms stored in the external storage device 506 include a computerprogram used to cause the CPU 501 to implement the functions offunctional units other than the above-described frame memory 107 andframe memory 206. Also, the data stored in the external storage device506 includes various kinds of information necessary for encoding ordecoding, such as what has been described above as already knowninformation (an intensity weight threshold, data in Table 1, and thelike).

The computer programs and data stored in the external storage device 506are appropriately loaded into the RAM 502 under the control of the CPU501 and processed by the CPU 501. Note that the above-described framememory 107 or frame memory 206 can be implemented by a memory devicesuch as the RAM 502 or the external storage device 506.

The I/F 507 functions as an interface configured to perform datacommunication with an external device. For example, a moving image or astill image can be acquired from an external server apparatus or imagecapturing apparatus to the RAM 502 or the external storage device 506via the I/F 507.

The CPU 501, the RAM 502, the ROM 503, the operation unit 504, thedisplay unit 505, the external storage device 506, and the I/F 507 areconnected to a bus 508. Note that the configuration shown in FIG. 5 ismerely an example of the hardware configuration of the computerapparatus applicable to the above-described image encoding apparatus orimage decoding apparatus, and various changes/modifications can be made.

Sixth Embodiment

In the above-described embodiments, a sub-block is used as an encodingunit. However, the encoding unit is not limited to a sub-block, and, forexample, a basic block may be used as an encoding unit. Also, thenumerical values used in the above description are merely used to make adetailed description, and are not intended to limit the above-describedembodiments to the used numerical values. For example, the value w, thevalue of the intensity weight threshold, and the size of a block used inthe above description are merely examples, and are not limited to theabove-described numerical values.

In the above-described embodiments, the image decoding apparatus hasbeen described as an apparatus different from the image encodingapparatus. However, the image decoding apparatus and the image encodingapparatus may be combined into one apparatus. In this case, thisapparatus can encode an input image and decode the encoded input imageas needed.

Also, the target to which the deblocking filter is applied is notlimited to the boundary between sub-blocks, and may be, for example, theboundary between transformation units. In the above-describedembodiments, the size of the deblocking filter is 8 pixels×8 pixels.However, the size is not limited to this. The size of the transformationunit may be the same as the sub-block or may be different from thesub-block.

Some or all of the above-described embodiments may appropriately be usedin combination. Alternatively, some or all of the above-describedembodiments may selectively be used.

OTHER EMBODIMENTS

Embodiment(s) of the present invention can also be realized by acomputer of a system or apparatus that reads out and executes computerexecutable instructions (e.g., one or more programs) recorded on astorage medium (which may also be referred to more fully as a‘non-transitory computer-readable storage medium’) to perform thefunctions of one or more of the above-described embodiment(s) and/orthat includes one or more circuits (e.g., application specificintegrated circuit (ASIC)) for performing the functions of one or moreof the above-described embodiment(s), and by a method performed by thecomputer of the system or apparatus by, for example, reading out andexecuting the computer executable instructions from the storage mediumto perform the functions of one or more of the above-describedembodiment(s) and/or controlling the one or more circuits to perform thefunctions of one or more of the above-described embodiment(s). Thecomputer may comprise one or more processors (e.g., central processingunit (CPU), micro processing unit (MPU)) and may include a network ofseparate computers or separate processors to read out and execute thecomputer executable instructions. The computer executable instructionsmay be provided to the computer, for example, from a network or thestorage medium. The storage medium may include, for example, one or moreof a hard disk, a random-access memory (RAM), a read only memory (ROM),a storage of distributed computing systems, an optical disk (such as acompact disc (CD), digital versatile disc (DVD), or Blu-ray Disc (BD)™),a flash memory device, a memory card, and the like.

According to the configuration of the present invention, it is possibleto appropriately decide the intensity of deblocking filter processingfor weighted intra-/inter-prediction and suppress a distortion generatedat a block boundary.

While the present invention has been described with reference toexemplary embodiments, it is to be understood that the invention is notlimited to the disclosed exemplary embodiments. The scope of thefollowing claims is to be accorded the broadest interpretation so as toencompass all such modifications and equivalent structures andfunctions.

The invention claimed is:
 1. An image encoding apparatus comprising: anencoding unit configured to encode an image by performing predictionprocessing for each block; a decision unit configured to decide a bSvalue of deblocking filter processing to be performed for a boundarybetween a first block and a second block adjacent to the first block,based on at least one of a mode used in the prediction processing in thefirst block and a mode used in the prediction processing in the secondblock, wherein the bS value corresponds to a strength for the deblockingfilter processing; and a processing unit configured to perform thedeblocking filter processing for the boundary according to the bS valuedecided by the decision unit, wherein in a case where a first mode isused in the prediction processing for a target block to be encoded,predicted pixels for the target block are derived by using pixels in animage including the target block, wherein in a case where a second modeis used in the prediction processing for the target block, the predictedpixels for the target block are derived by using pixels in an imagedifferent from the image including the target block, wherein in a casewhere a third mode is used in the prediction processing for the targetblock, the predicted pixels for the target block are generated by usingboth the pixels in the image including the target block and the pixelsin the image different from the image including the target block, andwherein the bS value of the deblocking filter processing to be performedfor the boundary between the first block and the second block in a casein which the third mode is used in the first block and the second modeis used in the second block is the same bS value as a bS value to beused in a case in which the third mode is used in the first block andthe first mode is used in the second block.
 2. The image encodingapparatus according to claim 1, wherein in a case where the third modeis used in at least one of the first block and the second block, thedecision unit sets the bS value of the deblocking filter processing tobe performed for the boundary between the first block and the secondblock to a bS value higher than in a case in which the second mode isused in both the first block and the second block.
 3. The image encodingapparatus according to claim 1, wherein the processing unit performs thedeblocking filter processing according to the bS value by selecting atarget component as a target of the deblocking filter processing from aluminance component and chroma components in the block in accordancewith the bS value.
 4. The image encoding apparatus according to claim 1,wherein the processing unit performs the deblocking filter processingaccording to the bS value by selecting, in accordance with the bS value,whether to perform the deblocking filter processing.
 5. The imageencoding apparatus according to claim 1, wherein the decision unitdecides, based on pixel values of pixels at the boundary, a filter to beapplied to a luminance component at the boundary from filters withdifferent smoothing effects.
 6. An image decoding apparatus for decodingencoded image data for each block, comprising: a decoding unitconfigured to decode an image by performing prediction processing foreach block; a decision unit configured to decide a bS value ofdeblocking filter processing to be performed for a boundary between afirst block and a second block adjacent to the first block, based on atleast one of a mode used in the prediction processing in the first blockand a mode used in the prediction processing in the second block,wherein the bS value corresponds to a strength for the deblocking filterprocessing; and a processing unit configured to perform the deblockingfilter processing for the boundary according to the bS value decided bythe decision unit, wherein in a case where a first mode is used in theprediction processing for a target block to be decoded, predicted pixelsfor the target block are derived by using pixels in an image includingthe target block, wherein in a case where a second mode is used in theprediction processing for the target block, the predicted pixels for thetarget block are derived by using pixels in an image different from theimage including the target block, wherein in a case where a third modeis used in the prediction processing for the target block, the predictedpixels for the target block are generated by using both the pixels inthe image including the target block and the pixels in the imagedifferent from the image including the target block, and wherein the bSvalue of the deblocking filter processing to be performed for theboundary between the first block and the second block in a case in whichthe third mode is used in the first block and the second mode is used inthe second block is the same bS value as a bS value to be used in a casein which the third mode is used in the first block and the first mode isused in the second block.
 7. The image decoding apparatus according toclaim 6, wherein in a case where the third mode is used in at least oneof the first block and the second block, the decision unit sets the bSvalue of the deblocking filter processing to be performed for theboundary between the first block and the second block to a bS valuehigher than in a case in which the second mode is used in both the firstblock and the second block.
 8. The image decoding apparatus according toclaim 6, wherein the processing unit performs the deblocking filterprocessing according to the bS value by selecting a target component asa target of the deblocking filter processing from a luminance componentand chroma components in the block in accordance with the bS value. 9.The image decoding apparatus according to claim 6, wherein theprocessing unit performs the deblocking filter processing according tothe bS value by selecting, in accordance with the bS value, whether toperform the deblocking filter processing.
 10. The image decodingapparatus according to claim 6, wherein the decision unit decides, basedon pixel values of pixels at the boundary, a filter to be applied to aluminance component at the boundary from filters with differentsmoothing effects.
 11. An image encoding method comprising: encoding animages by performing prediction processing for each block; deciding a bSvalue of deblocking filter processing to be performed for a boundarybetween a first block and a second block adjacent to the first block,based on at least one of a mode used in the prediction processing in thefirst block and a mode used in the prediction processing in the secondblock, wherein the bS value corresponds to a strength for the deblockingfilter processing; and performing the deblocking filter processing forthe boundary according to the bS value decided in the deciding, whereinin a case where a first mode is used in the prediction processing for atarget block to be encoded, predicted pixels for the target block arederived by using pixels in an image including the target block, whereinin a case where a second mode is used in the prediction processing forthe target block, the predicted pixels for the target block are derivedby using pixels in an image different from the image including thetarget block, wherein in a case where a third mode is used in theprediction processing for the target block, the predicted pixels for thetarget block are derived by using both the pixels in the image includingthe target block and the pixels in the image different from the imageincluding the target block, and wherein the bS value of the deblockingfilter processing to be performed for the boundary between the firstblock and the second block in a case in which the third mode is used inthe first block and the second mode is used in the second block is thesame bS value as a bS value to be used in a case in which the third modeis used in the first block and the first mode is used in the secondblock.
 12. An image decoding method for decoding encoded image data foreach block, comprising: decoding an image by performing predictionprocessing for each block; deciding a bS value of deblocking filterprocessing to be performed for a boundary between a first block and asecond block adjacent to the first block, based on at least one of amode used in the prediction processing in the first block and a modeused in the prediction processing in the second block, wherein the bSvalue corresponds to a strength for the deblocking filter processing;and performing the deblocking filter processing for the boundaryaccording to the bS value decided in the deciding, wherein in a casewhere a first mode is used in the prediction processing for a targetblock to be decoded, predicted pixels for the target block are derivedby using pixels in an image including the target block, wherein in acase where a second mode is used in the prediction processing for thetarget block, the predicted pixels for the target block are derived byusing pixels in an image different from the image including the targetblock, wherein in a case where a third mode is used in the predictionprocessing for the target block, the predicted pixels for the targetblock are generated by using both the pixels in the image including thetarget block and the pixels in the image different from the imageincluding the target block, and wherein, the bS value of the deblockingfilter processing to be performed for the boundary between the firstblock and the second block in a case in which the third mode is used inthe first block and the second mode is used in the second block is thesame bS value as a bS value to be used in a case in which the third modeis used in the first block and the first mode is used in the secondblock.
 13. A non-transitory computer-readable storage medium for storinga computer program configured to cause a computer to function as: anencoding unit configured to encode an images by performing predictionprocessing for each block; a decision unit configured to decide a bSvalue of deblocking filter processing to be performed for a boundarybetween a first block and a second block adjacent to the first block,based on at least one of a mode used in the prediction processing in thefirst block and a mode used in the prediction processing in the secondblock, wherein the bS value corresponds to a strength for the deblockingfilter processing; and a processing unit configured to perform thedeblocking filter processing for the boundary according to the bS valuedecided by the decision unit, wherein in a case where a first mode isused in the prediction processing for a target block to be encoded,predicted pixels for the target block are derived by using pixels in animage including the target block, wherein in a case where a second modeis used in the prediction processing for the target block, the predictedpixels for the target block are derived by using pixels in an imagedifferent from the image including the target block, wherein in a casewhere a third mode is used in the prediction processing for the targetblock, the predicted pixels for the target block are derived by usingboth the pixels in the image including the target block and the pixelsin the image different from the image including the target block, andwherein the bS value of the deblocking filter processing to be performedfor the boundary between the first block and the second block in a casein which the third mode is used in the first block and the second modeis used in the second block is the same bS value as a bS value to beused in a case in which the third mode is used in the first block andthe first mode is used in the second block.
 14. A non-transitorycomputer-readable storage medium for storing a computer programconfigured to cause a computer to function as: a decoding unitconfigured to decode an image by performing prediction processing foreach block; a decision unit configured to decide a bS value ofdeblocking filter processing to be performed for a boundary between afirst block and a second block adjacent to the first block, based on atleast one of a mode used in the prediction processing in the first blockand a mode used in the prediction processing in the second block,wherein the bS value corresponds to a strength for the deblocking filterprocessing; and a processing unit configured to perform the deblockingfilter processing for the boundary according to the bS value decided bythe decision unit, wherein in a case where a first mode is used in theprediction processing for a target block to be decoded, predicted pixelsfor the target block are derived by using pixels in an image includingthe target block, wherein in a case where a second mode is used in theprediction processing for the target block, the predicted pixels for thetarget block are derived by using pixels in an image different from theimage including the target block, wherein in a case where a third modeis used in the prediction processing for the target block, the predictedpixels for the target block are generated by using both the pixels inthe image including the target block and the pixels in the imagedifferent from the image including the target block, and wherein the bSvalue of the deblocking filter processing to be performed for theboundary between the first block and the second block in a case in whichthe third mode is used in the first block and the second mode is used inthe second block is the same bS value as a bS value to be used in a casein which the third mode is used in the first block and the first mode isused in the second block.